import { ADD_RECORD } from "redux/actiontypes"

const initialState :RecordType[] = []

export default function (state = initialState, action:any) {
    switch (action.type) {
        case ADD_RECORD:
            const { id, tags, createdAt, amount, category,note } = action.payload;
            return [
                ...state,
                 {id, tags, createdAt, amount, category,note}
            ]
           
        
        default:
            return state
  }
}